Open
Conversation
Author
|
I added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds
no_stdsupport and allow to run underno_std+allocenvironment.However there's one blocker: the RNG thing:
https://github.com/bczhc/bip38/blob/7265fa7b50b6b76faef2c206cf2205f0a9668c5c/src/lib.rs#L890-L899
In
generatemethod,thread_rngs are used. But underno_std, there's no such RNG. Here should have some discussions. One solution is to pass anRngCoretogenerate, and allow the caller to choose the RNG.I don't know if there's any method to generate nondeterministic random numbers under simple embedded systems. First we should grab a seed, and if the initial seed is deterministic, the further random numbers are all deterministic. It's impossible achieve an nondeterministic seed only from the software.
For example, here's an RNG implementation for Raspberry Pi Pico: